pkgname=anion-wm-3-hg
pkgver=25
pkgrel=1
pkgdesc="anion wm 3"
arch=(i686 x86_64)
url="http://code.google.com/p/anion3/"
license=('GPL2')
depends=('libsm' 'lua')
makedepends=('mercurial' 'rubber' 'texlive-latexextra' 'latex2html'
	     'libextl-3' 'libtu-3' 'texlive-htmlxml')
options=(docs)

_hgroot="https://anion3.googlecode.com/hg/"
_hgrepo="anion3"

build() {
  cd "$srcdir"
if [ $NOEXTRACT -eq 0 ]; then
  msg "Connecting to Mercurial server...."

  if [ -d $_hgrepo ] ; then
    cd $_hgrepo
    hg pull -u || return 1
    msg "The local files are updated."
  else
    hg clone $_hgroot $_hgrepo || return 1
  fi

  msg "Mercurial checkout done or server timeout"
  msg "Starting make..."

  rm -rf "$srcdir/$_hgrepo-build"
  cp -r "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
fi
  cd "$srcdir/$_hgrepo-build"

  #
  # BUILD HERE
  #
  cd anionwm-3/anionwm-3
  make -j1 PREFIX=/usr || return 1
  make DESTDIR="$pkgdir/" PREFIX=/usr install || return 1
}
